using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.IO;
using LuaInterface;


namespace SpaceWolf.GameLogic
{
    public class Mission
    {
        public string Description;
        public string FileName;
        public bool DoneStatus;

        public Mission(string description, string FileName)
        {
            this.Description = description;
            this.FileName = FileName;
        }
    }

    public class Missions
    {
        public ArrayList MissionList = new ArrayList();

        public Missions()
        {
            Lua lua = new Lua();
            try
            {
                foreach (string fileName in Directory.GetFiles(Directory.GetCurrentDirectory() + @"\Content\Missions\", "*.lua"))
                {
                    FileInfo fileInfo = new FileInfo(fileName);
                    lua.DoFile(@"Content\Missions\" + fileInfo.Name);
                    Mission mission = new Mission(lua["Description"].ToString(), fileInfo.Name);

                    MissionList.Add(mission);
                }
            }
            catch { }
            finally
            {
                lua.Dispose();
            }
        }
    }
}
